import request from '@/utils/request'

export function login(data) {
  return request({
    method: 'POST',
    url: '/sys/login',
    data
  })
}
/**
 * @description 获取用户资料
 * @param {*}
 * @returns Promise
 */
export function getProfile() {
  return request({
    url: '/sys/profile',
    method: 'POST'
  })
}
/**
 * @description 获取员工资料
 * @param {id} 用户id
 * @returns Promise
 */
export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`
  })
}

/**
 * @description: 保存员工信息
 * @param {*} data
 * @return {*}
 */
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}
